-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-100228: Warn from os.fork() if other threads exist. #100229
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Not comprehensive, best effort.
✅ Deploy Preview for python-cpython-preview canceled.
|
* Only warn in the parent process. * Add a test to test_os that a non-Python thread triggers the warning. * Avoid the system calls to count threads if we've already warned once. * The macOS API calls were written blind based on docs, will fix later if CI fails.
…o warn/os.fork/threads
I don't want the array of thread info but it may insist?
Yhg1s
reviewed
Dec 14, 2022
Misc/NEWS.d/next/Library/2022-12-13-17-29-09.gh-issue-100228.bgtzMV.rst
Outdated
Show resolved
Hide resolved
Let the thread free and clear things as it ends after we unblock it.
It could hide more than we intend and wouldn't do what I wanted in child processes that inherit the parents warnings state anyways.
…gtzMV.rst Co-authored-by: T. Wouters <[email protected]>
Co-authored-by: T. Wouters <[email protected]>
Xavier-Do
added a commit
to odoo-dev/odoo
that referenced
this pull request
Apr 26, 2024
Since python 3.12 python/cpython#100229, fork inside a multithreaded process will raise a warning. We actually have another solution to get rid of the fork that was implemented in more recent versions.
robodoo
pushed a commit
to odoo/odoo
that referenced
this pull request
Apr 26, 2024
Since python 3.12 python/cpython#100229, fork inside a multithreaded process will raise a warning. We actually have another solution to get rid of the fork that was implemented in more recent versions. closes #163562 Signed-off-by: Christophe Monniez (moc) <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not comprehensive, best effort warning. There are cases when threads exist that this code currently does not detect.
Starting with a
DeprecationWarning
for now, it is less disruptive than something likeRuntimeWarning
and most likely to only be seen in people's CI tests - a good place to start with this messaging.TODO: